<script type="text/javascript" src="{lib file=page.js}"></script>
<script type="text/javascript">
$.getJSON('index.php?app=goods&act=comments&id={$goods.goods_id}', function(jdata) {
  window.turnPage=new TurnPage({'data':jdata.retval,'pageSize':5,'listSize':5}); 
  turnPage.createPage=function(imgDivObj, pageData) {
        if (jdata.done)
        {
            if(jdata.retval.length>0){
               imgDivObj.empty(); 
               for(var i = 0; i < pageData.length; i++) {
                 var newLi=$('<tr><td align="center">' + pageData[i].from_user_name + '</td><td align="center">' + pageData[i].quantity + '</td><td align="center"><div class="xingxing">' + pageData[i].evaluation_text + '</div></td><td align="left"><div class="com-bd"><p>' + pageData[i].comment + '</p><p>' + pageData[i].add_time + '</p></div></td></tr>');
                 imgDivObj.append(newLi);
                }
                
            }else{
                $('#comment_wrap .info-box').html('<div class="comment_empty">抱歉，暂无评价！</div>');
            }
        }else{
            $('#comment_wrap .info-box').html('<div class="comment_empty">抱歉，暂无评价！</div>');
        }        
  };  
   turnPage.indexAction({'objName':'turnPage', 'imgDivName':'#goods_comments tbody','listDivName':'.goods-page'});    
});
</script>
<div class="box" id="comment_wrap">
  <h3 class="title">累计评价{if $comment_count}({$comment_count}){/if}</h3>
  <div class="info-box">
    <table border="0" cellspacing="0" cellpadding="0" width="100%" class="info-table" id="goods_comments" >
      <thead>
        <tr>
          <th width="20%">买家</th>
          <th width="15%">采购数量</th>
          <th width="15%">评价等级</th>
          <th width="50%">评价内容</th>
        </tr>
      </thead>
      <tbody></tbody>
    </table>
    <div class="goods-page"></div>
  </div>
</div>